<template>
  <el-table :data="data">
    <el-table-column label="资质名称" prop="company_qualification_name" />
    <el-table-column label="证书编号" prop="company_qualification_bh" />
    <el-table-column label="有效期" prop="company_qualification_time" />
    <el-table-column label="操作">
      <template #default="scope">
        <el-button type="primary" @click="download(scope.row)">下载</el-button>
      </template>
    </el-table-column>
  </el-table>
</template>

<script lang="ts" setup>
import type {Qualification} from "../types";
import {useFetch} from "@vueuse/core";

let {data} = defineProps<{
  data: Qualification[]
}>();

const download = (item: Qualification) => {
  useFetch(import.meta.env.VITE_API_BASE_URL + "/company/download?filePath=" + item.company_qualification_word).blob().then((res) => {
    console.log(res);
  })
}
</script>

<style scoped>

</style>